var GetQueryString = function (name) {
	var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
	var r = window.location.search.substr(1).match(reg);
	return r ? r[2] : null;
};
var sensors_server_url = ~location.search.indexOf('sensors=debug') ?
	'https://sensorsdata.ppdai.com/sa/?project=default' :
	'https://sensorsdata.ppdai.com/sa/?project=production';
(function(para) {
	var p = para.sdk_url, n = para.name, w = window, d = document, s = 'script',x = null,y = null;
	w['sensorsDataAnalytic201505'] = n;
	w[n] = w[n] || function(a) {return function() {(w[n]._q = w[n]._q || []).push([a, arguments]);}};
	var ifs = ['track','quick','register','registerPage','registerOnce','clearAllRegister','trackSignup', 'trackAbtest', 'setProfile','setOnceProfile','appendProfile', 'incrementProfile', 'deleteProfile', 'unsetProfile', 'identify','login','logout','trackLink','clearAllRegister'];
	for (var i = 0; i < ifs.length; i++) {
		w[n][ifs[i]] = w[n].call(null, ifs[i]);
	}
	if (!w[n]._t) {
		x = d.createElement(s), y = d.getElementsByTagName(s)[0];
		x.async = 1;
		x.src = p;
		y.parentNode.insertBefore(x, y);
		w[n].para = para;
	}
})({
	sdk_url: '//m.ppdaicdn.com/act/huan/js/sensorsdata.min.js?v=1',
	name: 'sa',
	server_url: sensors_server_url
});
sa.registerPage({
	product: 'other',
	platform: 'H5',
	product_h5: 'hh_h5_activity',
	h5_channel: '',
	user_agent: window.navigator.userAgent,
	source: GetQueryString('source') || ''
});
sa.quick('autoTrack');
